<script>
    /*订票机票点击事件*/


    $(function () {

        $(".xxxqq").on("click", function () {

            var id = $(this).data('id');
            var time = $(this).data('time');


            var r = confirm("确认是否订购该机票？");
            if (r == true) {


                // $("#commentForm").ajaxSubmit(function (data) {
                //     //Alert.pop("评论成功");
                //     $("#cmt_list").html(data);
                //     $("#textarea").val("");
                //
                //
                // })

                $.post('/flight/buy', {'id': id, 'depTime': time}, function (data) {
                    if (!data.success) {

                        alert(data.msg);
                    } else {
                        window.location.href = "/flight/buy1?id=" + id + "&time=" + time
                    }
                });
            } else {
                alert("取消预订!");
            }
        })
    })


</script>
<#list flights as f>
    <div id="flight_list" style="" render-loop="list">
        <div class="f-list ng-scope">
            <div class="f-item" id="airline-item-9C8542">
                <div class="f-item-info ng-scope" style="position:relative">
                    <div class="f-line">
                        <span class="airline-logo"><i id="logo-item-9C8930" class="airline-logo-9C"></i></span>
                        <p class="f-name ng-binding">${f.flightname}<span class="ng-binding"></span>
                        </p>
                        <p class="sub ng-binding">${f.flightno}</p>
                    </div>
                    <div class="f-time">
                        <div class="time ng-binding">${f.deptime}</div>
                        <p class="sub ng-binding">${f.depportname}</p>
                    </div>
                    <div class="through">
                        <div class="arrow"></div>
                        <p class="duration ng-binding"></p>
                        <div class="f-pop f-pop-stay">
                            <i class="pop-arrow"></i>
                            <strong>经停</strong>
                            <p>经停城市：<span class="ng-binding"></span></p>
                        </div>
                    </div>
                    <div class="f-time">
                        <div class="time ng-binding">${f.arrtime}
                        </div>
                        <p class="sub ng-binding">${f.arrportname}</p>
                    </div>
                    <div class="item item-btn btn_search">
                        <a id="btn_search" class="xxxqq" data-id="${f.id}" data-time="${depTime}">订购</a>
                    </div>
                </div>
            </div>
        </div>

    </div>


</#list>
